package cn.neusoft.annoaop;

import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;
@Component//创建一个对象
@Aspect//声明一个切面类
public class Aop {
	@Pointcut("execution(public * cn.neusoft.annoaop.*Service.*(..))")
	public void pointCut() {

	}
	@Before("pointCut()")
	public void before() {
		System.out.println("前置通知");
	}
	@After("pointCut()")
	public void after() {
		System.out.println("后置通知");
	}

    @AfterThrowing("pointCut()")
    public void afterThrowing(){
        System.out.println("异常后通知");
    }
    @AfterReturning("pointCut()")
    public void afterReturning(){
        System.out.println("返回后通知");
    }

}

